onmessage = function (event) {
    let end_time = event.data;
    if(end_time>new Date().getTime()){
        end_time=end_time/1000;
        setInterval(function(){
            let now_time =  Math.round(new Date().getTime()/1000);  //现在的时间
            let time =end_time - now_time;
            let hour = parseInt(time / 60 / 60 );
            let minute = parseInt(time / 60 % 60);
            let seconds = parseInt(time % 60);
            if(now_time<= end_time){
                if(hour < 10){
                    hour = "0" + hour;
                }
                if(minute < 10){
                    minute = "0" + minute;
                }
                if(seconds < 10){
                    seconds = "0" + seconds;
                }
                postMessage({hour:hour,minute:minute,second:seconds}); //返回这一秒的数据
            }
        },1000);
    }
};